package com.zdyt.opc.entity;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

@Data
@AllArgsConstructor
@NoArgsConstructor
public class OpcData {

    private String itemId;
    private Object value;
    private String cnName;
    private String title;


    @Override
    public String toString() {
        return "OpcData{" +
                "itemId='" + itemId + '\'' +
                ", value=" + value +
                ", cnName='" + cnName + '\'' +
                ", title='" + title + '\'' +
                '}';
    }

    public boolean equals(Object obj){
        if(this == obj){
            return true;
        }
        if(obj == null){
            return false;
        }
        if(obj instanceof OpcData){
            OpcData o = (OpcData) obj;
            if(this.cnName.equals(o.cnName)
                    &&this.value==o.value
                    &&this.itemId==o.itemId
                    &&this.title==o.title){
                return true;
            }
        }
        return false;
    }
}
